<?php

/**
 * +------ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER * ---------+
 * +----------------------------------------------------------------------------+
 * | PHPKiisf - Keep It in Simple Framework										|
 * | Version 1.0																|
 * | Copyright (C) <2013>  Mario Cezzare <mcezzare@gmail.com>					|
 * | Blog: http://mcezzare.blogspot.com.br										|
 * |																			|
 * | This program is part of PHPKiisf, and is free software: you can			|
 * | redistribute it and/or modify it under the terms of the GNU 				|
 * | General Public License as published by										|
 * | the Free Software Foundation, either version 3 of the License, or			|
 * | (at your option) any later version.										|
 * |																			|
 * | This program is distributed in the hope that it will be useful,			|
 * | but WITHOUT ANY WARRANTY; without even the implied warranty of				|
 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the				|
 * | GNU General Public License for more details.								|
 * | You should have received a copy of the GNU General Public License			|
 * | along with this program.  If not, see <http://www.gnu.org/licenses/>.		|
 * +----------------------------------------------------------------------------+
 * | Author : <Mario Cezzare Angelicola Chiodi> <mcezzare@gmail.com>			|
 * +----------------------------------------------------------------------------+
 * | Contributors																|
 * |																			|
 * +----------------------------------------------------------------------------+
 *
 */
/**
 * @package	Lib
 * @access	public
 * @since	2013-03-08
 * @author	Mario Cezzare <mcezzare@gmail.com>
 */
/**
 * Arquivo de inicialização do aplicativo
 *
 */
$console_mode = false;
if ( php_sapi_name() == 'cli' || PHP_SAPI == 'cli' ) {
		$console_mode = true;
		ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . "/Users/mcezzare/Sites/_DEVELOP/phpkiisf" );

}
else {
		session_start();
}

/* Includes
 *
 * Maybe the only manual/static  required includes
 *
 * Everything else called from dispatcher are loaded by autoloader
 *
 * @see autoloader.php
 */
require_once "config.class.php";
require_once "context.php";

/**
 * Determins if the  application is in debug mode,
 * It must be disabled on production environments and
 * used ONLY to solve problems.
 */
$debug = false;
if ( $context == "deploy" ) {
		if ( isset( $_GET[ "debug" ] ) ) {
				$debug = $_GET[ "debug" ] == true ? true : false;
		}
}
$config = new config();
if ( !$console_mode ) {
		require_once "./includes/functions.php";
		require_once "autoloader.class.php";
}
else {
		require_once "autoloader.class.php";
}
$util				 = new utils();
$default_controller	 = new default_controller();

?>